package com.wang.utills;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class R implements Serializable {

    private Integer code;
    private  String mesg;
    private  Object data;

    public static  R SUCCESS(Integer code){
        return new R(code, null, null);
    }
    public static  R SUCCESS(Integer code, String mesg){
        return new R(code, mesg, null);
    }
    public static  R SUCCESS(Integer code, String mesg,Object data){
        return new R(code, mesg, data);
    }

    public static  R ERROR(Integer code, String mesg){
        return new R(code, mesg, null);
    }

}
